package com.timebank.volunteer.mapper;

import com.timebank.volunteer.pojo.dto.VolunteerDTO;
import com.timebank.volunteer.pojo.entity.Volunteer;
import com.timebank.volunteer.pojo.vo.VolunteerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author shiliuyinzhen
 */
@Mapper
public interface VolunteerMapper{

    /**
     * 分页查询志愿服务列表
     * @param volunteerDTO
     * @return
     */
    List<Volunteer> selectVolunteerList(VolunteerDTO volunteerDTO);

    /**
     * 新增志愿服务
     * @param volunteer
     */
    int insertVolunteerService(Volunteer volunteer);

    /**
     * 修改志愿服务信息
     * @param volunteer
     * @return
     */
    int updateVolunteerById(Volunteer volunteer);

    /**
     * 批量删除志愿服务信息
     * @param volunteerIds
     * @return
     */
    int deleteVolunteerByIds(Long[] volunteerIds);

    /**
     * 根据id查询志愿服务
     * @param volunteerId
     * @return
     */
    Volunteer selectVolunteerById(Long volunteerId);

    /**
     * 获取已报名志愿服务列表
     * @param userId
     * @param volunteerDTO
     * @return
     */
    List<VolunteerVO> getSignUpVolunteerList(@Param("userId") Long userId,@Param("volunteer") VolunteerDTO volunteerDTO);

    /**
     * 修改志愿服务封面
     * @param cover
     * @param volunteerId
     * @return
     */
    int updateVolunteerCoverById(@Param("cover") String cover, @Param("volunteerId") Long volunteerId);

    /**
     * 根据id查询志愿服务信息
     * @param volunteerId
     * @return
     */
    VolunteerVO getVolunteerById(Long volunteerId);

    /**
     * 批量查询志愿服务
     * @param volunteerIds
     * @return
     */
    List<Volunteer> getVolunteerByIds(Long[] volunteerIds);
}
